<?
class Link_system extends Common{
    var $table = 'links';
    var $id_field = 'lin_id';
    var $name_field = 'lin_title';
    var $result = array();
    public function __construct($id){
        parent::__construct($id);
        $this->result = db_first('SELECT cat_id,cat_name
                                  FROM categories_multi
                                  WHERE cat_active = 1 AND cat_type = "system" AND cat_id = "'.$this->id.'"
                                  LIMIT 1');
        $this->name = $this->result['cat_name'];
        $this->description = $this->result['cat_name'];
        $this->url = DOMAIN.generate_cat_link_system_url($this->result);
    }
    public function list_link() {
      $query = new db_query('SELECT lin_id,lin_title,lin_link,lin_age,lin_pr,lin_active,lin_resources,lin_author,lin_site_type
                            FROM '.$this->table.'
                            WHERE lin_active = 1 AND lin_cat_id = '.$this->id.'
                            LIMIT 150');
     return $query->resultArray();
    }
}
?>